package cn.dianhun.om.jpa.controller;

import cn.dianhun.om.jpa.pojo.SysRoleEntity;
import cn.dianhun.om.jpa.repository.RoleRepository;
import cn.dianhun.om.jpa.utills.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cyt
 * @create 2020-07-08 10:44
 */

@RequestMapping("/api")
@RestController
public class testRoleController {

    @Autowired
    private RoleRepository roleRepository;

    @GetMapping("/getAll")
    public R getAllRole() {
        List<SysRoleEntity> roleRepositoryAll = roleRepository.findAll();
        return R.ok().data("list", roleRepositoryAll);
    }
}
